﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_DLL.Product.DAO;

namespace ERP_RORZE_PRODUCT.Product.WTS
{
    public partial class ctrlMachineWTSInput : DevExpress.XtraEditors.XtraUserControl
    {
        ClsWTSDAO clsWTSDAO = new ClsWTSDAO();
        DataTable dt;
        public ctrlMachineWTSInput()
        {
            InitializeComponent();
        }

        private void ctrlMachineWTSInput_Load(object sender, EventArgs e)
        {
            dt = clsWTSDAO.GetAllMachine();
            cbMachine.DataSource = dt;
            cbMachine.DisplayMember = "MachineID";
            cbMachine.ValueMember = "MachineID";

            //
            dt = clsWTSDAO.GetAllMONo();
            cbMONo.DataSource = dt;
            cbMONo.DisplayMember = "MONo";
            cbMONo.ValueMember = "MONo";

            //
            dt = clsWTSDAO.GetAllOptionID();
            cbOption.DataSource = dt;
            cbOption.DisplayMember = "OptionID";
            cbOption.ValueMember = "OptionID";

            //
            dt = clsWTSDAO.GetAllStaff();
            cbStaff.DataSource = dt;
            cbStaff.DisplayMember = "StaffID";
            cbStaff.ValueMember = "StaffID";

            //
            dt = clsWTSDAO.GetAllWork();
            cbWorkID.DataSource = dt;
            cbWorkID.DisplayMember = "WorkID";
            cbWorkID.ValueMember = "WorkID";

        }

        private void btnAddHalf_Click(object sender, EventArgs e)
        {
            if (txtShift.Text != "T0" && txtShift.Text != "T1" && txtShift.Text != "T2" && txtShift.Text != "T3")
            {
                MessageBox.Show("Ca làm việc phải nằm trong danh sách T0, T1, T1, T3");
            }
            //else if()
            //{}
        }
    }
}
